package com.wangshouyu.mp.system.sign;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月07日 09:38
 * @description 签名信息
 */
public class MpSignInfo implements Serializable {

    /**
     * 微信加密签名
     */
    private String signature;

    /**
     * 微信加密签名
     */
    private String msg_signture;

    /**
     * 时间戳
     */
    private String timestamp;

    /**
     * 随机数
     */
    private String nonce;

    /**
     * 随机字符串
     */
    private String echostr;

    /**
     * 空或raw时表示不加密  aes加密
     */
    private String encrypt_type;

    /**
     * openId
     */
    private String openId;

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getMsg_signture() {
        return msg_signture;
    }

    public void setMsg_signture(String msg_signture) {
        this.msg_signture = msg_signture;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getEchostr() {
        return echostr;
    }

    public void setEchostr(String echostr) {
        this.echostr = echostr;
    }

    public String getEncrypt_type() {
        return encrypt_type;
    }

    public void setEncrypt_type(String encrypt_type) {
        this.encrypt_type = encrypt_type;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MpSignInfo signInfo = (MpSignInfo) o;
        return Objects.equals(signature, signInfo.signature) &&
                Objects.equals(msg_signture, signInfo.msg_signture) &&
                Objects.equals(timestamp, signInfo.timestamp) &&
                Objects.equals(nonce, signInfo.nonce) &&
                Objects.equals(echostr, signInfo.echostr) &&
                Objects.equals(encrypt_type, signInfo.encrypt_type) &&
                Objects.equals(openId, signInfo.openId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(signature, msg_signture, timestamp, nonce, echostr, encrypt_type, openId);
    }

    @Override
    public String toString() {
        return "SignInfo{" +
                "signature='" + signature + '\'' +
                ", msg_signture='" + msg_signture + '\'' +
                ", timestamp='" + timestamp + '\'' +
                ", nonce='" + nonce + '\'' +
                ", echostr='" + echostr + '\'' +
                ", encrypt_type='" + encrypt_type + '\'' +
                ", openId='" + openId + '\'' +
                '}';
    }
}
